<?php //get the q parameter from URL
$rid=$_GET["rid"];
$likes = urldecode($_GET["likes"]);
$hates = urldecode($_GET["hates"]);
$con = mysql_connect('localhost', 'chokecc_davidlu', 'freethechildren');
mysql_query("SET NAMES 'utf8'",$con);
if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }

mysql_select_db("chokecc_davidtest", $con);


$sql="update pw_likes set likes = likes + 1 where rid = ".$rid;
$result = mysql_query($sql);
//output the response
if(!$result) {
	echo "Database returns an error!";
}
$sql="SELECT * FROM comment where type = 'blog' and id = ".$id;
$result = mysql_query($sql);
//output the response
while($row = mysql_fetch_array($result))
 {
 	$con_ini = $row["content"];
	$auth_ini = $row["author"];
	$time_ini = $row["date_posted"];
	echo $auth_ini." said: <br>".$con_ini."<br>";
 }
mysql_close($con);
?>
